﻿using System.Linq;
using AutoMapper;
using Microsoft.Extensions.Logging;
using netCoreStudy.Entities;
using netCoreStudy.Entities.Base;
using netCoreStudy.IService;

namespace netCoreStudy.Service
{
	public class RoleService : BaseService<Role>, IRoleService
	{
		public RoleService(ApiDbContext context, IMapper mapper, ILogger<BaseService<Role>> logger) : base(context, mapper, logger)
		{
		}

		public bool ExistByName(string name)
		{
			return DbSet.Any(x => x.Name == name);
		}
	}
}